package com.it.blog.mapper;

import com.it.blog.domain.Article;
import com.it.blog.dto.PlaceOnFileDTO;
import com.it.blog.query.ArticleQuery;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ArticleMapper {
    @Select("select * from tb_article order by update_time desc")
    List<Article> findAll();
    List<Article> queryPage(ArticleQuery articleTypeQuery);
    Article findOne(Long id);
    void addArticle(Article articleType);
    void updateArticle(Article articleType);
    @Delete("delete from tb_article where id=#{id};")
    void deleteArticle(Long id);
    void batchArticles(Long[] ids);

    List<PlaceOnFileDTO> getArticleTimeStatistics();

    List<Article> getRelatedArticles(Article article);

    List<Article> getArchiveDetail(String yearMonth);
    @Select("select * from tb_article where article_state=1 order by update_time desc")
    List<Article> findAllArticle();
}
